import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/repair/api/repair/query/page',
    method: 'get',
    params: query
  })
}
export function fetchBroadInfo(query) {
  return request({
    url: '/device/api/assetField/query/list',
    method: 'get',
    params: query
  })
}
// 保存设备信息
export function saveDeviceInfo(query) {
  return request({
    url: '/repair/api/repair/save',
    method: 'post',
    data: query
  })
}
// 更新设备信息
export function updateDeviceInfo(query) {
  return request({
    url: '/repair/api/repair/update',
    method: 'put',
    data: query
  })
}
// 维修单详细信息
export function fetchDetailInfo(query) {
  return request({
    url: '/repair/api/repair/queryInfo/' + query,
    method: 'get'
  })
}
// 维修单编辑查询信息
export function fetchEditInfo(query) {
  return request({
    url: '/repair/api/repair/query/' + query,
    method: 'get'
  })
}
// 导出
export function exportFile(params) {
  console.log(params)
  return request({
    url: '/device/api/deviceAsset/export',
    method: 'post',
    data: params
  })
}
// 批量导入
export function importFile() {
  return request({
    url: '/device/api/deviceAsset/import',
    method: 'post'
    // data: params
  })
}
// 下载批量导入模板

export function downloadTemplete(query) {
  return request({
    url: '/minio/minio/download/excelTemplate',
    method: 'post'
    // params: query
  })
}
// 删除台账
export function deleteDeviceInfo(query) {
  return request({
    url: '/repair/api/repair/deleteById/' + query,
    method: 'delete'
    // data: query
  })
}
// 启用设备
export function useInfo(id) {
  return request({
    url: `/device/api/deviceAsset/start/${id}`,
    method: 'put'
    // data: query
  })
}
// 停用

export function uselessInfo(id) {
  return request({
    url: `/device/api/deviceAsset/stop/${id}`,
    method: 'put'
    // data: query
  })
}
// 档案资料
export function fetchHistoryInfo(id) {
  return request({
    url: `/device/api/assetArchive/query/list/${id}`,
    method: 'get'
    // data: query
  })
}
// 改期
export function changeDate(query) {
  return request({
    url: `/repair/api/repair/alterTime`,
    method: 'post',
    data: query
  })
}
// 分配
export function allocate(query) {
  return request({
    url: `/repair/api/repair/assign`,
    method: 'post',
    data: query
  })
}
// 挂起审批
export function awaitapprove(query) {
  return request({
    url: `/repair/api/repair/auditHang`,
    method: 'post',
    data: query
  })
}

// 验收
export function checkItem(query) {
  return request({
    url: `/repair/api/maintenance/check`,
    method: 'post',
    data: query
  })
}
